package com.pp.basedata.service;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.pp.basedata.mapper.UserMapper;
import com.pp.basedata.model.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.io.Serializable;
import java.util.List;

@Service
public class UserService extends ServiceImpl<UserMapper, User> {

    @Autowired
    UserMapper userMapper;

    @Override
    public boolean save(User entity) {
        return super.save(entity);
    }

    @Override
    public boolean removeById(Serializable id) {
        return super.removeById(id);
    }

    @Override
    public boolean updateById(User entity) {
        return super.updateById(entity);
    }

    @Override
    public User getById(Serializable id) {
        return super.getById(id);
    }

    @Override
    public User getOne(Wrapper<User> queryWrapper, boolean throwEx) {
        return super.getOne(queryWrapper, throwEx);
    }


    @Override
    public List<User> list(Wrapper<User> queryWrapper) {
        return super.list(queryWrapper);
    }

    /**
     * 分页查询
     * @param page
     * @param userWrapper
     * @return
     */
    public IPage<User> selectPage(IPage<User>page,Wrapper<User> userWrapper){
        return userMapper.selectPage(page, userWrapper);
    }


}
